<?php

if(empty($photo)){ ?>
    <h1 class="logo-name" style="font-size: 30px;text-align: center;letter-spacing: 0px">未上传相片..</h1>
    <script>
        $(window).ready(function(){
            $('#photo_title').find('.ibox-tools').html('<a title="上传相片" id="upload-photo" data-toggle="modal" data-target="#myPhotoDialog" data-data=" ">' +
                '<i class="fa fa-upload" style="color: black"></i></a>');
        })
    </script>
    <?php
}else{
    $pics = explode('|;|',rtrim($photo->mp_other,'|;|'));
    if(count($pics)>=5){
        $html = '';
    }else{
        $html = '<a title="上传相片" data-toggle="modal" id="upload-photo" data-target="#myPhotoDialog" data-data='.\yii\helpers\Json::encode($photo).'><i class="fa fa-upload" style="color: black"></i></a>';
    }
    ?>
    <div class="lightBoxGallery">
        <?php
        foreach($pics as $pic) {
            ?>
            <a href="<?= Yii::$app->params['img_path'].$pic ?>" title="相册" data-gallery=""><img style="height: 200px" src="<?= Yii::$app->params['img_path'].$pic ?>"></a>
            <a title="删除" style=" color: darkred;position: relative;z-index: 99;left:-22px; top:-84px; " id="photo_del" onclick="PhotoDel(<?=$photo->mp_id ?>,'<?=$pic ?>')">
                <b><i class="fa fa-trash-o" style="font-size: 16px" ></i></b>
            </a>
            <?php
        }
        ?>
        <div id="blueimp-gallery" class="blueimp-gallery">
            <div class="slides"></div>
            <h3 class="title"></h3>
            <a class="prev"><</a>
            <a class="next">></a>
            <a class="close">×</a>
            <a class="play-pause"></a>
            <ol class="indicator"></ol>
        </div>
    </div>
    <script>
        $(window).ready(function(){
            $('#photo_title').find('.ibox-tools').html('<?=$html; ?>');
        })
    </script>
    <?php
}
?>
